import org.junit.jupiter.api.Test;

import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

public class TestReentrantLock {

    private Lock lock = new ReentrantLock();

    @Test
    public void testMethod(){

        lock.lock();
        try{

            for (int i = 0; i < 5; i++){
                System.out.println("ThreadName = " + Thread.currentThread().getName() + "_" + (i+1));
            }

        }finally {
            lock.unlock();
        }




    }

}
